package com.asion.qkan.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.asion.qkan.ui.fragment.categoryfragment.AllFragment;

import java.util.List;

/**
 * Created by gino on 16-10-15.
 */

public class AllAdapter extends FragmentPagerAdapter {
    private List<String> list ;

    public AllAdapter(FragmentManager fm, List<String> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return AllFragment.newInstance(list.get(position));
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list.get(position);
    }
}
